As the U.S. population is disproportionately aging, a specific research area that has garnered recent attention is the link between major depressive disorder (MDD) and heart failure (HF) since both are highly prevalent conditions and also highly comorbid. Prevalence of MDD among HF patients ranges from 11% to 25% in outpatients and 35% to 70% in hospitalized patients. Further, co-morbid depressive disorder is a predictor of mortality, re-hospitalization and worsening HF. Despite this, appropriate management of co-morbid depression in HF patients remains under-appreciated in routine clinical care. While several studies have examined the prevalence of depression in HF, and a few have also investigated the incidence of depression, the temporal relationship between incident MDD and incident HF is undetermined and under-studied. Understanding this temporal relationship will provide insight as to whether incident MDD is a risk factor for incident HF, a consequence of incident HF, and/or a comorbid factor that exacerbates HF, or vice versa. To address this critical gap, in this proposed study, we will leverage robust and longitudinal electronic health record (EHR) systems at Mayo Clinic, along with our extensive experience and decades of research in EHR data mining, and epidemiological studies in MDD and HF, to understand (1) the bidirectional risk association between MDD and HF, (2) the role of co-existing conditions in MDD and HF, and (3) patient outcomes and healthcare utilization for MDD and HF.